<template>
	<view>

		<view class="p3  l50">
			<view class="">
				<rich-text :nodes="find.content"></rich-text>
			</view>
			<view class="p3"></view>
			<button class="by1 button_bg" @tap="send">
				<text class="p2">我已清楚风险，确定继续</text>
			</button>


		</view>
	</view>
</template>

<script>
	import $C from '@/common/banmi/config.js';
	import $H from '@/common/banmi/request.js';
	export default {
		data() {
			return {
				find: {}
			}
		},
		onLoad() {
			this.init();
		},
		methods: {
			init() {
				let requestParams = {
					id: uni.getStorageSync('article_6')
				};
				
				if (!uni.getStorageSync('article_6')) {
					uni.showModal({
						title: '提示',
						content: '请在后台选择关联的注销的文章',
						success: function(res) {
							uni.navigateBack()
						}
					});
					return
				}  
				
				$H.post('banmi.php/Article/ArticleView', requestParams).then(ret => {
					if (ret.status != 200) {
						uni.showModal({
							title: '提示',
							content: ret.msg,
							success: function(res) {
								uni.navigateBack()
							}
						});
						return
					}

					this.find = ret.data.find;
				})

			},
			send() {
				var that = this;
				uni.showModal({
					title: '提示',
					content: '注销数据将被删除无法恢复',
					confirmText: '确认注销',
					success: function(res) {
						if (res.confirm) {
							that.ajax_send()
						}
					}
				});
			},
			ajax_send() {
				var that = this;
				let requestParams = {
					id: this.id

				};
				$H.post('banmi.php/user/UserDel', requestParams).then(ret => {

					uni.showToast({
						title: ret.msg,
						icon: 'none',
						duration: 1000
					});
					if (ret.status == 200) {
						uni.removeStorageSync('token');
						uni.removeStorageSync('user_id');
						uni.removeStorageSync('nickname');
						uni.removeStorageSync('face');
						setTimeout(function() {
							uni.$emit('banmi_login', {
								title: 1,
							});
							uni.switchTab({
								url: '/' + $C.jump_index
							})
						}, 2000);

					}

				})

			}
		}
	}
</script>

<style>
</style>